package cn.uce.cc.srv.utils;
/**
 * 仲裁转化
 * @author Administrator
 *
 */

import cn.uce.base.vo.ArbComplaintsDetVo;
import cn.uce.base.vo.ArbComplaintsVo;
import cn.uce.base.vo.ArbQueryVo;
import cn.uce.utils.StringUtil;
import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ScreenBusiArbPubApiConver {

	public static Map converterArb_List(String str_api) {
		Map map = new HashMap();
		if (!ScreenBusiConditionUtils.isEmptyForApi(str_api, "data")) {
			return map;
		}
		;
		List<ArbQueryVo> list_ArbQueryVo = new ArrayList();
		ArbQueryVo arbQueryVo = null;
		JSONObject jSONObject = JSONObject.parseObject(str_api);
		String str_temp = jSONObject.getString("data");
		List lst = JSONObject.parseArray(str_temp);

		for (Object obj : lst) {
			String obj_temp = obj.toString();
			ArbComplaintsVo arbComplaintsVo = JSONObject.parseObject(obj_temp, ArbComplaintsVo.class);
			arbQueryVo = new ArbQueryVo();

			if (StringUtil.isNotBlank(arbComplaintsVo.getArbitrationNo())) {
				arbQueryVo.setComplaintNum(arbComplaintsVo.getArbitrationNo());
			}
			if (null != arbComplaintsVo.getSubmitTm()) {
				arbQueryVo.setComplaintTime(DateUtil.dateToString(arbComplaintsVo.getSubmitTm(), null));
			}
			if (StringUtil.isNotBlank(arbComplaintsVo.getSubmitCompCode())) {
				arbQueryVo.setComplaintcompany(arbComplaintsVo.getSubmitCompName());
				;
			}
			if (StringUtil.isNotBlank(arbComplaintsVo.getSubmitDeptCode())) {
				arbQueryVo.setComplaintDep(arbComplaintsVo.getSubmitDeptName());
			}
			if (StringUtil.isNotBlank(arbComplaintsVo.getReasondesc())) {
				arbQueryVo.setComplaintDetail(arbComplaintsVo.getReasondesc());
			}
			if (StringUtil.isNotBlank(arbComplaintsVo.getProcessEmpName())) {
				arbQueryVo.setDealMan(arbComplaintsVo.getProcessEmpName());
			}
			list_ArbQueryVo.add(arbQueryVo);
		}
		map.put("arbitrationInfo", list_ArbQueryVo);
		return map;
	}

	public static ArbComplaintsDetVo converterArb_Detail(String str_api) {
        ArbComplaintsDetVo arbComplaintsVo = null;
		if (!ScreenBusiConditionUtils.isEmptyForApi(str_api, "data")) {
			return arbComplaintsVo;
		}
		;
		JSONObject jSONObject = JSONObject.parseObject(str_api);
		String str_temp = jSONObject.getString("data");
        arbComplaintsVo = JSONObject.parseObject(str_temp, ArbComplaintsDetVo.class);//
		/*
		 * List<ArbComplaintsProcessDetailVo>
		 * processDetailList=arbComplaintsVo.getProcessDetailList();
		 * 
		 * ArbComplaintsProcessResultVo
		 * arbResultDetailVo=arbComplaintsVo.getProcessResult();
		 * 
		 * 
		 * 
		 * 
		 * List<ArbProcessResultDetailVo> resultDetailList=
		 * arbResultDetailVo.getResultDetailList(); ArbProcessResultDetailVo
		 * arbProcessResultDetailVo=null;
		 * 
		 * if (null!=resultDetailList&&!resultDetailList.isEmpty()) {
		 * arbProcessResultDetailVo=resultDetailList.get(0); map.put("resultDetailList",
		 * resultDetailList); } if(null!=processDetailList) { map.put("arbitrationList",
		 * processDetailList); } // ArbComplaintsProcessResultVo
		 * processResult=arbComplaintsVo.getProcessResult();
		 * 
		 * 
		 * 
		 * ArbComplaintsProcessResultVo arbPrcess=arbComplaintsVo.getProcessResult();
		 * 
		 * 
		 * List<ArbProcessResultDetailVo> list=arbPrcess.getResultDetailList();
		 * map.put("complaint", arbComplaintsVo);
		 */
		return arbComplaintsVo;

		/*
		 * ArbitrationVo arbitrationVo= new ArbitrationVo();
		 * 
		 * //运单号 if(StringUtil.isNotBlank(arbComplaintsVo.getWaybillNo())) {
		 * arbitrationVo.setWayNum(arbComplaintsVo.getWaybillNo()); } //投诉省区 if
		 * (StringUtil.isNotBlank(arbComplaintsVo.getSubmitAreaName())){
		 * arbitrationVo.setArbProvince(arbComplaintsVo.getSubmitAreaName()); } //投诉日期
		 * if (null != arbComplaintsVo.getSubmitTm()) {
		 * arbitrationVo.setArbTime(DateUtil.dateToString(arbComplaintsVo.getSubmitTm(),
		 * "yyyy-MM-dd HH:dd:ss")); }
		 * 
		 * //寄托物 if (StringUtil.isNotBlank(arbComplaintsVo.getGoodsName())) {
		 * arbitrationVo.setConsignment(arbComplaintsVo.getGoodsName()); }
		 * 
		 * //货损件数 if (null!=arbComplaintsVo.getDamagedQuantity()) {
		 * arbitrationVo.setMarAmount(arbComplaintsVo.getDamagedQuantity().toString());
		 * } //产品类型 if (StringUtil.isNotBlank(arbComplaintsVo.getProductTypeCode())) {
		 * arbitrationVo.setProType(arbComplaintsVo.getProductTypeCode()); } //投诉类型----
		 * if (StringUtil.isNotBlank(arbComplaintsVo.getTypeCode())) {
		 * arbitrationVo.setArbType(arbComplaintsVo.getTypeCode()); } //投诉类别---- if
		 * (StringUtil.isNotBlank(arbComplaintsVo.getTypeCategory())) {
		 * arbitrationVo.setArbSort(arbComplaintsVo.getTypeCategory()); } //被诉部门 if
		 * (StringUtil.isNotBlank(arbComplaintsVo.getResponDeptName())) {
		 * arbitrationVo.setArbedDep(arbComplaintsVo.getResponDeptName()); } //签收日期 if (
		 * null != arbComplaintsVo.getConsignedTm()) {
		 * arbitrationVo.setSignTime(DateUtil.dateToString(arbComplaintsVo.
		 * getConsignedTm(), "yyyy-MM-dd HH:dd:ss")); } //包装方式 if
		 * (StringUtil.isNotBlank(arbComplaintsVo.getPacking())) {
		 * arbitrationVo.setPackType(arbComplaintsVo.getPacking()); } //货损子单号 if
		 * (StringUtil.isNotBlank(arbComplaintsVo.getChildrenWaybillNo())) {
		 * arbitrationVo.setMarChildNum(arbComplaintsVo.getChildrenWaybillNo()); }
		 * 
		 * //被诉省区 if (StringUtil.isNotBlank(arbComplaintsVo.getResponAreaName())) {
		 * arbitrationVo.setArbedProvince(arbComplaintsVo.getResponAreaName()); }
		 * 
		 * //件数 if (null!=arbComplaintsVo.getQuantity()) {
		 * arbitrationVo.setItemAmount(arbComplaintsVo.getQuantity().toString()); }
		 * //声明价值 if (null!=arbComplaintsVo.getInsuranceFee()) {
		 * arbitrationVo.setStatePrice(arbComplaintsVo.getInsuranceFee().toString()); }
		 * //投诉人 if (StringUtil.isNotBlank(arbComplaintsVo.getSubmitEmpName())) {
		 * arbitrationVo.setArbName(arbComplaintsVo.getSubmitEmpName()); } //投诉 if
		 * (StringUtil.isNotBlank(arbComplaintsVo.getSubmitDeptName())) {
		 * arbitrationVo.setArbDep(arbComplaintsVo.getSubmitDeptName()); } //发货日期 if
		 * (StringUtil.isNotBlank(arbComplaintsVo.getWaybillSendTm().toString())) {
		 * arbitrationVo.setShipTime(DateUtil.dateToString(arbComplaintsVo.
		 * getWaybillSendTm(), "yyyy-MM-dd HH:dd:ss")); }
		 * 
		 * //重量 if (null!=arbComplaintsVo.getWeight()) {
		 * arbitrationVo.setArbweight(arbComplaintsVo.getWeight().toString()); } //索赔金额
		 * if (null!=arbComplaintsVo.getApplyamt()) {
		 * arbitrationVo.setIndemnifyPrice(arbComplaintsVo.getApplyamt().toString()); }
		 * //联系电话 if (StringUtil.isNotBlank(arbComplaintsVo.getTelephone())) {
		 * arbitrationVo.setArbPhone(arbComplaintsVo.getTelephone()); } //投诉内容 if
		 * (StringUtil.isNotBlank(arbComplaintsVo.getReasondesc())) {
		 * arbitrationVo.setArbContent(arbComplaintsVo.getReasondesc()); } //附件信息 if
		 * (StringUtil.isNotBlank(arbComplaintsVo.getFileIds())) {
		 * arbitrationVo.setAnnexmsg(arbComplaintsVo.getFileIds()); } //投诉成立 if
		 * (null!=arbPrcess.getWhetherEstabilsh()) { if
		 * (arbPrcess.getWhetherEstabilsh()==1) { arbitrationVo.setIsArb("成立"); }else
		 * if(arbPrcess.getWhetherEstabilsh()==0) { arbitrationVo.setIsArb("不成立"); }
		 * 
		 * } //不成立原因 if (null!=arbPrcess.getEstabilshReason()) {
		 * if(arbPrcess.getEstabilshReason()==0) { arbitrationVo.setNotArbResult("");
		 * }else {
		 * arbitrationVo.setNotArbResult(arbPrcess.getEstabilshReason().toString()); }
		 * 
		 * } //遗失时间 if (null!=arbProcessResultDetailVo) {
		 * arbitrationVo.setShipTime(DateUtil.dateToString(arbProcessResultDetailVo.
		 * getLossTime(), "yyyy-MM-dd HH:dd:ss")); } //定则类型 if
		 * (StringUtil.isNotBlank(arbProcessResultDetailVo.getDzTypeCode())) {
		 * arbitrationVo.setDutyType(arbProcessResultDetailVo.getDzTypeCode()); } //定则类别
		 * if (StringUtil.isNotBlank(arbProcessResultDetailVo.getDzTypeCategory())) {
		 * arbitrationVo.setDutySort(arbProcessResultDetailVo.getDzTypeCategory()); }
		 * //原因分析 if
		 * (StringUtil.isNotBlank(arbProcessResultDetailVo.getDzTypeReason())) {
		 * arbitrationVo.setReasonAnalysis(arbProcessResultDetailVo.getDzTypeReason());
		 * } //遗失时间 if
		 * (StringUtil.isNotBlank(arbProcessResultDetailVo.getLossTime().toString())) {
		 * arbitrationVo.setShipTime(DateUtil.dateToString(arbProcessResultDetailVo.
		 * getLossTime(), "yyyy-MM-dd HH:dd:ss")); } //延误天数 if
		 * (StringUtil.isNotBlank(arbProcessResultDetailVo.getDelayDays().toString()))
		 * {
		 * arbitrationVo.setDelayDays(arbProcessResultDetailVo.getDelayDays().toString()
		 * ); } //遗失/货损件数 if (null!=arbProcessResultDetailVo.getAbnormalNum()){
		 * arbitrationVo.setDelayNums(arbProcessResultDetailVo.getAbnormalNum().toString
		 * ()); } //损失价值 if
		 * (StringUtil.isNotBlank(arbProcessResultDetailVo.getColum1())) {
		 * arbitrationVo.setLossValue(arbProcessResultDetailVo.getColum1()); } //货物实际价值
		 * if (StringUtil.isNotBlank(arbProcessResultDetailVo.getColum2())) {
		 * arbitrationVo.setGoodsRelValue(arbProcessResultDetailVo.getColum2()); }
		 * 
		 * //责任部门 if
		 * (StringUtil.isNotBlank(arbProcessResultDetailVo.getResponsibleDeptName())) {
		 * arbitrationVo.setDutyDep(arbProcessResultDetailVo.getResponsibleDeptName());
		 * } //责任省区 if
		 * (StringUtil.isNotBlank(arbProcessResultDetailVo.getResponsibleAreaName())) {
		 * arbitrationVo.setDutyProvince(arbProcessResultDetailVo.getResponsibleAreaName
		 * ()); } //处罚金额 if
		 * (StringUtil.isNotBlank(arbProcessResultDetailVo.getPenaltySum().toString()))
		 * {
		 * arbitrationVo.setPunishPay(arbProcessResultDetailVo.getPenaltySum().toString(
		 * )); } //责任人 if
		 * (StringUtil.isNotBlank(arbProcessResultDetailVo.getResponsibleEmpName())) {
		 * arbitrationVo.setPrincipal(arbProcessResultDetailVo.getResponsibleEmpName());
		 * } //返款部门 if (StringUtil.isNotBlank(arbPrcess.getBackDeptName())) {
		 * arbitrationVo.setRebateDep(arbPrcess.getBackDeptName()); } //返款省区 if
		 * (StringUtil.isNotBlank(arbPrcess.getBackProvinceName())) {
		 * arbitrationVo.setRebateProvince(arbPrcess.getBackProvinceName()); } //返款金额 if
		 * (null!=arbPrcess.getBackMoney()) {
		 * arbitrationVo.setRebatePay(arbPrcess.getBackMoney().toString()); }
		 * 
		 * //处理依据 if (StringUtil.isNotBlank(arbPrcess.getHandleBasis())) {
		 * arbitrationVo.setHandleBasis(arbPrcess.getHandleBasis()); } //处理说明 if
		 * (StringUtil.isNotBlank(arbPrcess.getHandleExplain())) {
		 * arbitrationVo.setHandleDescription(arbPrcess.getHandleExplain()); }
		 * //处理列表----------------------未提供 // if
		 * (StringUtil.isNotBlank(arbComplaintsVo.getSubmitDeptCode())) { //
		 * arbitrationVo.setArbitrationList(arbComplaintsVo.getSubmitDeptCode()); // }
		 */

	}

}
